Host to frontend connection
To start of with, I decided that the connection should be done through WebRTC, due to two reasons.
- Cost, if I can minimize the amount of time a server is involved, then that means a lower cost for me.
- Latency, mainly as I would like to maximize the possibility of doing a real time controller game (for example a karting game or fighting game).
WebRTC signaling as well as lobbies are handled through a Rust + Axum server as well as a Redis instance for horizontal scalability albeit that is so far untested and I am so far only planning for the future.
Controlling the frontend from the host
The host kind of acts as a highly opinionated server side rendering library, where a set of C++ components in Godot directly map to a set of Lit components on the frontend.
The messages between the two is defined using Protobufs.